// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

#include "Drawable.h"

// ----------------------------------------------------------------------------

struct DrawableWrap : Drawable, bpy::wrapper<Drawable>
{
    void draw(View3d* v) const override
    {
        // This has bitten me hard. See http://bit.ly/bXxW2o
        get_override("draw")(bpy::ptr(v));
    }
};

// ----------------------------------------------------------------------------

void pyInitDrawable()
{
    bpy::class_<DrawableWrap, ref<DrawableWrap>, 
                boost::noncopyable>("Drawable")
        .def("draw", bpy::pure_virtual(&Drawable::draw))
    ;
}

